<?

if (!isset($DATA['mainmenu'])) {

	$temp = $CURRENT->getFilteredTree(array('attr' => AA_VISIBLE, 'tag' => PT_MAPABLE));
	
	list(,$temp) = each($temp);
	
	while (!($temp['tag'] & PT_MAIN))
	if (is_array($temp['data']))
		$temp = array_shift($temp['data']);
	else
		break;
	
	$DATA['mainmenu'] = $temp['data'];
	$DATA['mainmenu-lang'] = ($CONTEXT['lang'] == LANG_DEF) ? '' : "/$CONTEXT[lang]";

}



